<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .d1{
            width:500px;
            height:200px;
            border :1px dashed black;
        }
    </style>
</head>
<body>
<div>123</div>
<div class = "d1" style = "display:none">book1</div>
<div class = "d1" style = "visibility:hidden ">book2</div>
<div class = "d1" style = "opacity: 0">book3</div>
<div class = "d1">aa</div>
  <script>
    let a = [10,20,30,40,50,60,70,80]
    let d = [5,30,50,100]

    d.forEach(x=>{
      if(a.includes(x)){
        let pos = a.findIndex(item=>item == x)
        console.log('pos:',pos)

        pos && a.splice(pos,1)
        console.log(a)
      }
    })

    console.log(a.findIndex(item=>item==100))

  </script>
</body>
</html>